﻿using Volo.Abp;

namespace Shared.Service.DataPermissions
{
    public class OwnerDataPermission: BaseDataPermissionState
    {
       

        /// <summary>
        /// 所属人所在门店
        /// </summary>
        public string OwnerSchoolId { get; }

        /// <summary>
        /// 所属人标识
        /// </summary>
        public string OwnerId { get; }

        /// <summary>
        /// 没启用的
        /// </summary>
        public static readonly OwnerDataPermission Disable =
            new OwnerDataPermission(DataPermissionState.Disable);

        /// <summary>
        /// 
        /// </summary>
        public static OwnerDataPermission Null = new OwnerDataPermission(DataPermissionState.Null);

        /// <summary>
        /// 
        /// </summary>
        public static OwnerDataPermission All = new OwnerDataPermission(DataPermissionState.All);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="state"></param>
        protected OwnerDataPermission(DataPermissionState state) : base(state)
        {

        }

        public OwnerDataPermission(string ownerId, string ownerSchoolId)
            : this(DataPermissionState.Normal)
        {
            OwnerId = Check.NotNullOrWhiteSpace(ownerId, nameof(ownerId));
            OwnerSchoolId = ownerSchoolId;
        }
    }
}
